Package-level declarations

Types

Link copied to clipboard
sealed interface ImageSize

The size of the GTK Image. The possible values correspond to GTK's IconSize, plus the Specific class to represent an exact value that will be set with Image.setPixelSize.

Link copied to clipboard
data class Mark(val value: Double, val position: PositionType, val markup: String? = null)

A visual mark that can be set on Scale.

Link copied to clipboard
data class Offset(val name: String, val value: Double)

A mark that can be used on LevelBar to give it a style based on its current value.

Link copied to clipboard
interface PopoverScope
Link copied to clipboard
sealed interface ProgressBarState
Link copied to clipboard
sealed interface RadioGroupState
Link copied to clipboard
sealed interface SelectionMode<M : SelectionModel<ListIndexModel.ListIndex>>

Functions

Link copied to clipboard
@Composable
fun Box(modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL, spacing: Int = 0, homogeneous: Boolean = false, content: @Composable () -> Unit)

Creates a org.gnome.gtk.Box that arranges child widgets into a single row or column.

Link copied to clipboard
@Composable
fun Button(onClick: () -> Unit, modifier: Modifier = Modifier, hasFrame: Boolean = true, child: @Composable () -> Unit = {})
@Composable
fun Button(label: String, onClick: () -> Unit, modifier: Modifier = Modifier, hasFrame: Boolean = true)

Creates a org.gnome.gtk.Button that triggers a callback when clicked.

Link copied to clipboard
@Composable
fun Calendar(modifier: Modifier = Modifier, date: LocalDate = LocalDate(year = DateTime.nowLocal().year, month = Month.JANUARY, dayOfMonth = 1), showDayNames: Boolean = true, showHeading: Boolean = true, showWeekNumber: Boolean = false, onDaySelect: (date: LocalDate) -> Unit? = null, onNextMonth: () -> Unit? = null, onNextYear: () -> Unit? = null, onPreviousMonth: () -> Unit? = null, onPreviousYear: () -> Unit? = null)
@Composable
fun Calendar(modifier: Modifier = Modifier, day: Int = 1, month: Int = 0, year: Int = DateTime.nowLocal().year, showDayNames: Boolean = true, showHeading: Boolean = true, showWeekNumber: Boolean = false, onDaySelect: (day: Int, month: Int, year: Int) -> Unit? = null, onNextMonth: () -> Unit? = null, onNextYear: () -> Unit? = null, onPreviousMonth: () -> Unit? = null, onPreviousYear: () -> Unit? = null)

Creates a org.gnome.gtk.Calendar to display a Gregorian calendar, one month at a time.

Link copied to clipboard
@Composable
fun CenterBox(modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL, start: @Composable () -> Unit = {}, end: @Composable () -> Unit = {}, baselinePosition: BaselinePosition = BaselinePosition.CENTER, shrinkCenterLast: Boolean = true, center: @Composable () -> Unit)

Creates a org.gnome.gtk.CenterBox that arranges three children in a row, keeping the middle child centered as well as possible.

Link copied to clipboard
@Composable
fun CheckButton(active: Boolean, onActiveRequest: (active: Boolean) -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false)

Creates a org.gnome.gtk.CheckButton without a label or custom child content.

@Composable
fun CheckButton(active: Boolean, onActiveRequest: (active: Boolean) -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false, child: @Composable () -> Unit)

Creates a org.gnome.gtk.CheckButton with a custom child composable as its content.

@Composable
fun CheckButton(active: Boolean, label: String, onActiveRequest: (active: Boolean) -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false)

Creates a org.gnome.gtk.CheckButton with a simple text label.

Link copied to clipboard
@Composable
fun Entry(text: String, onTextChange: (String) -> Unit, modifier: Modifier = Modifier, attributes: AttrList = emptyAttributes, placeholderText: String? = null, editable: Boolean = true, visibility: Boolean = true, activatesDefault: Boolean = false, alignment: Float = 0.0f, hasFrame: Boolean = true, inputHints: InputHints = InputHints.NONE, inputPurpose: InputPurpose = InputPurpose.FREE_FORM, invisibleChar: Char? = null, maxLength: Int = 0, progressFraction: Double = 0.0, tabs: TabArray? = null, enableUndo: Boolean = true, maxWidthChars: Int = -1, widthChars: Int = -1)

Creates a org.gnome.gtk.Entry used to input text.

Link copied to clipboard
@Composable
fun FlowBox(modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL, activateOnSingleClick: Boolean = true, columnSpacing: Int = 0, rowSpacing: Int = 0, horizontalAdjustment: Adjustment = nullAdjustment, verticalAdjustment: Adjustment = nullAdjustment, homogeneous: Boolean = false, maxChildrenPerLine: Int = 7, minChildrenPerLine: Int = 0, content: @Composable () -> Unit)

Creates a org.gnome.gtk.FlowBox that arranges its children in a reflowing grid.

Link copied to clipboard
@Composable
fun Frame(modifier: Modifier = Modifier, labelXAlign: Float = 0.0f, label: @Composable () -> Unit? = null, child: @Composable () -> Unit)

Creates a org.gnome.gtk.Frame used to surround its child with a decorative frame and an optional label.

Link copied to clipboard
@Composable
fun <T : GObject> GridView(model: SelectionModel<T>, modifier: Modifier = Modifier, enableRubberband: Boolean = false, minColumns: Int = 1, maxColumns: Int = 7, singleClickActivate: Boolean = false, tabBehaviour: ListTabBehavior = ListTabBehavior.ALL, onActivate: (position: Int) -> Unit? = null, child: @Composable (item: T) -> Unit)

Creates a org.gnome.gtk.GridView bound to the given model. Each element is a composable created using child.

@Composable
fun <M : SelectionModel<ListIndexModel.ListIndex>> GridView(items: Int, selectionMode: SelectionMode<M>, modifier: Modifier = Modifier, enableRubberband: Boolean = false, minColumns: Int = 1, maxColumns: Int = 7, singleClickActivate: Boolean = false, tabBehaviour: ListTabBehavior = ListTabBehavior.ALL, onActivate: (position: Int) -> Unit? = null, child: @Composable (index: Int) -> Unit): M

Creates a org.gnome.gtk.GridView with items items. Each element is a composable created using child.

Link copied to clipboard
@Composable
fun GtkApplicationWindow(title: String?, onClose: () -> Unit, modifier: Modifier = Modifier, styles: List<CssProvider> = emptyList(), decorated: Boolean = true, defaultHeight: Int = 0, defaultWidth: Int = 0, deletable: Boolean = true, fullscreen: Boolean = false, maximized: Boolean = false, handleMenubarAccel: Boolean = true, modal: Boolean = false, resizable: Boolean = true, init: ApplicationWindow.() -> Unit = {}, content: @Composable () -> Unit)

Creates a org.gnome.gtk.ApplicationWindow, a freeform application window.

Link copied to clipboard
@Composable
fun HorizontalBox(modifier: Modifier = Modifier, spacing: Int = 0, homogeneous: Boolean = false, content: @Composable () -> Unit)

A horizontally aligned Box

Link copied to clipboard
@Composable
fun HorizontalSeparator(modifier: Modifier = Modifier)

A horizontally aligned Separator.

Link copied to clipboard
@Composable
fun IconButton(icon: ImageSource.Icon, onClick: () -> Unit, modifier: Modifier = Modifier, hasFrame: Boolean = true)

Creates a org.gnome.gtk.Button with a single icon.

Link copied to clipboard
@Composable
fun Image(image: ImageSource?, modifier: Modifier = Modifier, iconSize: ImageSize = ImageSize.Inherit)

Creates a org.gnome.gtk.Image that displays an image. Generally used to display an icon.

Link copied to clipboard
@Composable
fun Label(text: String, modifier: Modifier = Modifier, ellipsize: EllipsizeMode = EllipsizeMode.NONE, justify: Justification = Justification.LEFT, lines: Int = -1, maxWidthChars: Int = -1, naturalWrapMode: NaturalWrapMode = NaturalWrapMode.INHERIT, selectable: Boolean = false, singleLineMode: Boolean = false, useMarkup: Boolean = false, useUnderline: Boolean = false, widthChars: Int = -1, wrap: Boolean = false, wrapMode: WrapMode = WrapMode.WORD, xAlign: Float = 0.5f, yAlign: Float = 0.5f, onActivateCurrentLink: () -> Unit? = null, onActivateLink: (uri: String) -> Boolean? = null, onCopyClipboard: () -> Unit? = null)

Creates a org.gnome.gtk.Label that displays text.

Link copied to clipboard
@Composable
fun LevelBar(value: Double, modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL, inverted: Boolean = false, maxValue: Double = 1.0, minValue: Double = 0.0, mode: LevelBarMode = LevelBarMode.CONTINUOUS, offsets: List<Offset> = emptyList())

Creates a org.gnome.gtk.LevelBar that shows a level indicator.

Link copied to clipboard
@Composable
fun LinkButton(label: String, uri: String, modifier: Modifier = Modifier, visited: Boolean = false, onActivateLink: () -> Boolean = { false })

Creates a org.gnome.gtk.LinkButton that opens a URI.

Link copied to clipboard
@Composable
fun ListBox(modifier: Modifier = Modifier, activateOnSingleClick: Boolean = true, adjustment: Adjustment? = null, selectionMode: SelectionMode = SelectionMode.SINGLE, showSeparators: Boolean = false, placeholder: @Composable () -> Unit = {}, content: @Composable () -> Unit)

TODO:

Link copied to clipboard
@Composable
fun <T : GObject> ListView(model: SelectionModel<T>, modifier: Modifier = Modifier, enableRubberband: Boolean = false, singleClickActivate: Boolean = false, showSeparators: Boolean = false, tabBehaviour: ListTabBehavior = ListTabBehavior.ALL, onActivate: (position: Int) -> Unit? = null, child: @Composable (item: T) -> Unit)

Creates a org.gnome.gtk.ListView bound to the given model. Each element is a composable created using child.

@Composable
fun <M : SelectionModel<ListIndexModel.ListIndex>> ListView(items: Int, selectionMode: SelectionMode<M>, modifier: Modifier = Modifier, enableRubberband: Boolean = false, singleClickActivate: Boolean = false, showSeparators: Boolean = false, tabBehaviour: ListTabBehavior = ListTabBehavior.ALL, onActivate: (position: Int) -> Unit? = null, child: @Composable (index: Int) -> Unit): M

Creates a org.gnome.gtk.ListView with items items. Each element is a composable created using child.

Link copied to clipboard
@Composable
fun Overlay(mainChild: @Composable () -> Unit, modifier: Modifier = Modifier, overlays: @Composable () -> Unit)

Creates a org.gnome.gtk.Overlay that places widgets on top of a single main child.

Link copied to clipboard
@Composable
fun Picture(image: ImageSource.PaintableFactory?, modifier: Modifier = Modifier, alternativeText: String? = null, canShrink: Boolean = true, contentFit: ContentFit = ContentFit.CONTAIN)

Creates a org.gnome.gtk.Picture that displays a picture.

Link copied to clipboard
@Composable
fun Popover(trigger: @Composable PopoverScope.() -> Unit, modifier: Modifier = Modifier, arrow: Boolean = true, content: @Composable () -> Unit)
Link copied to clipboard
@Composable
fun ProgressBar(state: ProgressBarState, modifier: Modifier = Modifier, ellipsize: EllipsizeMode = EllipsizeMode.NONE, inverted: Boolean = false, pulseStep: Double = 0.1, showText: Boolean = false, text: String? = null)

Creates a org.gnome.gtk.ProgressBar that displays the progress of a long-running operation.

Link copied to clipboard
@Composable
fun RadioButton(state: RadioGroupState, active: Boolean, onSelect: () -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false)

Creates a org.gnome.gtk.CheckButton as a radio button without a label or custom child content.

@Composable
fun RadioButton(state: RadioGroupState, active: Boolean, onSelect: () -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false, child: @Composable () -> Unit)

Creates a org.gnome.gtk.CheckButton as a radio button with a custom child composable as its content.

@Composable
fun RadioButton(state: RadioGroupState, active: Boolean, label: String, onSelect: () -> Unit, modifier: Modifier = Modifier, inconsistent: Boolean = false, useUnderline: Boolean = false)

Creates a org.gnome.gtk.CheckButton as a radio button with a simple text label.

Link copied to clipboard
@Composable
fun <Item : GObject> rememberMultiSelectionModel(items: List<Item>): MultiSelection<Item>
Link copied to clipboard
@Composable
fun <Item : GObject> rememberNoSelectionModel(items: List<Item>): NoSelection<Item>
Link copied to clipboard

Creates and remembers a ProgressBarState for controlling a ProgressBar composable.

Link copied to clipboard
Link copied to clipboard
@Composable
fun <M : SelectionModel<ListIndexModel.ListIndex>> rememberSelectionModel(itemsCount: Int, selectionMode: SelectionMode<M>): M
Link copied to clipboard
@Composable
fun <Item : GObject> rememberSingleSelectionModel(items: List<Item>): SingleSelection<Item>
Link copied to clipboard
@Composable
fun Revealer(reveal: Boolean, modifier: Modifier = Modifier, transitionType: RevealerTransitionType = RevealerTransitionType.NONE, transitionDuration: Int = 0, content: @Composable () -> Unit)

Creates a org.gnome.gtk.Revealer that animates the transition of its child's visibility.

Link copied to clipboard
@Composable
fun Scale(value: Double, onChange: (ScrollType, Double) -> Unit, modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL, lower: Double = 0.0, upper: Double = 100.0, digits: Int = 1, drawValue: Boolean = true, hasOrigin: Boolean = true, valuePosition: PositionType = PositionType.TOP, fillLevel: Double = Double.MAX_VALUE, flippable: Boolean = true, stepIncrements: Double = 0.0, pageIncrements: Double = 0.0, inverted: Boolean = false, showFillLevel: Boolean = false, marks: List<Mark> = emptyList())

Creates a org.gnome.gtk.Scale that allows to select a numeric value with a slider control.

Link copied to clipboard
@Composable
fun ScrolledWindow(modifier: Modifier = Modifier, horizontalScrollbarPolicy: PolicyType = PolicyType.AUTOMATIC, verticalScrollbarPolicy: PolicyType = PolicyType.AUTOMATIC, kineticScrolling: Boolean = true, minContentHeight: Int? = null, maxContentHeight: Int? = null, minContentWidth: Int? = null, maxContentWidth: Int? = null, overlayScrolling: Boolean = true, placement: CornerType = CornerType.TOP_LEFT, propagateNaturalHeight: Boolean = false, propagateNaturalWidth: Boolean = false, content: @Composable () -> Unit)

Creates a org.gnome.gtk.ScrolledWindow that makes its child scrollable.

Link copied to clipboard
@Composable
fun Separator(modifier: Modifier = Modifier, orientation: Orientation = Orientation.HORIZONTAL)

Creates a org.gnome.gtk.Separator that draws a line to separate other widgets.

Link copied to clipboard
@Composable
fun Spinner(modifier: Modifier = Modifier, spinning: Boolean = false)

Creates a org.gnome.gtk.Spinner that displays an icon-size spinning animation.

Link copied to clipboard
@Composable
fun Switch(active: Boolean, onToggle: (Boolean) -> Unit, modifier: Modifier = Modifier)

Creates a org.gnome.gtk.Switch used for toggle states.

Link copied to clipboard
@Composable
fun ToggleButton(active: Boolean, onToggle: () -> Unit, modifier: Modifier = Modifier, hasFrame: Boolean = true, child: @Composable () -> Unit = {})
@Composable
fun ToggleButton(label: String, active: Boolean, onToggle: () -> Unit, modifier: Modifier = Modifier, hasFrame: Boolean = true)

Creates a org.gnome.gtk.ToggleButton used for toggle states.

Link copied to clipboard
@Composable
fun VerticalBox(modifier: Modifier = Modifier, spacing: Int = 0, homogeneous: Boolean = false, content: @Composable () -> Unit)

A vertically aligned Box

Link copied to clipboard
@Composable
fun VerticalSeparator(modifier: Modifier = Modifier)

A vertically aligned Separator.

Link copied to clipboard
@Composable
fun WindowControls(modifier: Modifier = Modifier, side: PackType = PackType.START)

Creates a org.gnome.gtk.WindowControls that displays a window's control buttons.